#ifndef DATAHELPER_H
#define DATAHELPER_H
#include <QtCore>
#include <QSqlQuery>
#include "ewha.h"

class DataHelper
{
public:
	bool newChart(const SPatient &patient);
	QList<SPatient> searchChart(const SPatient &patient);
	SPatient getChart(int iID);
	QList<SCapturePerDate> searchCapturePerDay(int iID);
	QList<SCapture> searchCapture(int iPatientID, QDate dateCapture);
	bool newCapture(const SCapture &capture);
	bool existPatient(const SPatient &patient);

private:
	void printQueryInfo(const QSqlQuery&query) const;
	void connect();
	void disconnect(bool bCommit = true);
};

#endif // DATAHELPER_H
